package com.lijin.study.java.util;

import java.util.Timer;
import java.util.TimerTask;

public class TimerTest {

	public static void main(String[] args) {
		Timer timer = new Timer();
		TimerTask task = new TimerTask() {
			private int count = 0;
			@Override
			public void run() {
				count ++;
				System.out.println("current count is :" + count);
			}
		};
		timer.schedule(task, 1000, 2000);
		Timer timer2 = new Timer();
		timer2.schedule(task, 2000, 3000);
		System.out.println("main is done");
	}

}
